<?php

class Saver
{
	public function SaveState($model,$type){
	
		$model->generalinformation->Establishment_Id = $model->Id;
		$model->generalinformation->attributes = $_POST['Generalinformation'];
		$model->generalinformation->save();
		
		$model->buildingconstruction->Establishment_Id = $model->Id;
		$model->buildingconstruction->attributes = $_POST['Buildingconstruction'];
		$model->buildingconstruction->save();
		
		$model->exitdetail->Establishment_Id = $model->Id;
		$model->exitdetail->attributes = $_POST['exitdetail'];
		$model->exitdetail->save();
		
		$model->meansofegress->Establishment_Id = $model->Id;
		$model->meansofegress->attributes = $_POST['Meansofegress'];
		$model->meansofegress->save();
		
		
		$model->sectionaloccupancy->Establishment_Id = $model->Id;
		$model->sectionaloccupancy->attributes = $_POST['Sectionaloccupancy'];
		$model->sectionaloccupancy->save();
	}
}

?>